package com.business.business.web.web;

import cn.hutool.json.JSONObject;
import com.business.business.common.base.BaseController;
import com.business.business.support.annotaion.Action;
import com.business.business.support.annotaion.At;
import com.business.business.support.model.RespEntity;
import com.business.business.web.service.EmergencyCommandService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;

/**
 * @Author: YangYu
 * @ClassName: EmergencyCommandController
 * @Date: Created in 11:12 2024/4/27
 * @Description: 应急指挥
 */
@Action
@RequestMapping(value = "emergencyCommand")
public class EmergencyCommandController extends BaseController {

    @Resource
    private EmergencyCommandService emergencyCommandService;


    /**
     * @Author YangYu
     * @Description 应急指挥信息新增、编辑
     * @Date Created in 11:13 2024/4/27
     * @Param [jsonParam]
     */

    @At(value = "/addOrUpdate",method = RequestMethod.POST)
    public RespEntity regionDel(@RequestBody(required = false) JSONObject jsonParam) {
        return emergencyCommandService.addOrUpdate(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 应急指挥信息删除
     * @Date Created in 11:13 2024/4/27
     * @Param [jsonParam]
     */

    @At(value = "/emergencyCommandDel",method = RequestMethod.POST,param = {"id"})
    public RespEntity emergencyCommandDel(@RequestBody(required = false) JSONObject jsonParam) {
        return emergencyCommandService.emergencyCommandDel(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 应急指挥信息分页列表
     * @Date Created in 11:13 2024/4/27
     * @Param [jsonParam]
     */

    @At(value = "/emergencyCommandListPage",method = RequestMethod.GET,param = {"page","limit"})
    public RespEntity emergencyCommandListPage(@RequestBody(required = false) JSONObject jsonParam) {
        return emergencyCommandService.emergencyCommandListPage(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 应急保障情况（数量）
     * @Date Created in 11:13 2024/4/27
     * @Param [jsonParam]
     */

    @At(value = "/emergencyCommandCount",method = RequestMethod.GET,param = {"page","limit"})
    public RespEntity emergencyCommandCount(@RequestBody(required = false) JSONObject jsonParam) {
        return emergencyCommandService.emergencyCommandCount(jsonParam);
    }
    /**
     * @Author YangYu
     * @Description 应急指挥信息列表
     * @Date Created in 11:13 2024/4/27
     * @Param [jsonParam]
     */

    @At(value = "/emergencyCommandList",method = RequestMethod.GET)
    public RespEntity emergencyCommandList(@RequestBody(required = false) JSONObject jsonParam) {
        return emergencyCommandService.emergencyCommandList(jsonParam);
    }

}
